<?php
require('./public/fun.php');
require('./public/sql.class.php');


//_mysqlToFileForYao();	//中药数据从mysql转为文件
//_mysqlToFileForFang();	//方剂数据从mysql转为文件
//_mysqlToFileForBing();	//医案数据从mysql转为文件

//中药数据从mysql转为文件
function _mysqlToFileForYao(){
	$pdo = MyPdo::init();
	$sql = 'select name,xing,jing,gong from yao';
	$res = $pdo->dql($sql,array());
	F('./data/yao',json_encode($res));
}


//方剂数据从mysql转为文件
function _mysqlToFileForFang(){
	$pdo = MyPdo::init();
	$sql = 'select name,fang,gong from fang';
	$res = $pdo->dql($sql,array());
	F('./cache/fang',json_encode($res));
}
//医案数据从mysql转为文件
function _mysqlToFileForBing(){
	$pdo = MyPdo::init();
	$sql = 'select name,info from bing';
	$res = $pdo->dql($sql,array());
	F('./cache/bing',json_encode($res));
}




